import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../view/Home/home.vue'

const routes = [
  {
    path: '/',
    redirect: { name: 'home' },
    component: Home
  },
  {
    path: '/home',
    name: 'home',
    component: () => import(/* webpackChunkName: "Home" */ '../view/Home/home.vue'),
    meta: { FooterNav: true, keepAlive: true }
  },
  {
    path: '/cart',
    name: 'cart',
    component: () => import(/* webpackChunkName: "Cart" */ '../view/Cart/Cart.vue'),
    meta: { FooterNav: true, keepAlive: true }
  },
  {
    path: '/mine',
    name: 'mine',
    component: () => import(/* webpackChunkName: "Mine" */ '../view/Mine/Mine.vue'),
    meta: { FooterNav: true, keepAlive: true }
  },
  {
    path: '/order',
    name: 'order',
    component: () => import(/* webpackChunkName: "Order" */ '../view/Order/Order.vue'),
    meta: { FooterNav: true, keepAlive: true }
  },
  {
    path: '/store',
    name: 'store',
    component: () => import(/* webpackChunkName: "Store" */ '../view/Store/Store.vue'),
    meta: { FooterNav: false, keepAlive: false }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

router.beforeEach(() => {})

export default router
